package demo_api

import (
	"app.com/api.v1/internal/service"
	"app.com/common.v1"
	"github.com/gin-gonic/gin"
	"net/http"
)

type HandlerDemo struct {
}

func (*HandlerDemo) test(ctx *gin.Context) {
	var req TestDemoReq
	err := ctx.BindJSON(&req)
	if err != nil {
		ctx.JSON(http.StatusBadRequest, gin.H{
			"error": err.Error(),
		})
		return
	}

	s := service.ServiceLK
	s.DemoService.Test(ctx)
	rsp := &common.Result{}
	ctx.JSON(http.StatusOK, rsp.Success(&TestDemoRsp{
		Aa:  "test ok",
		Res: "good",
	}))
}
